<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改病人建档信息')"/>
    <th:block th:include="include :: select2-css"/>
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body>
<div class="main-content">
    <form class="form-horizontal" id="form-user-edit" th:object="${patient}">
        <h4 class="form-header h4">建档信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label">病人ID：</label>
                    <div class="col-sm-4">
                        <input class="form-control" type="text" readonly="true" th:field="*{patientId}"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label is-required">姓名：</label>
                    <div class="col-sm-4">
                        <input name="name" placeholder="病人姓名" class="form-control" type="text" maxlength="30"
                               th:field="*{name}" required>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label is-required">手机号码：</label>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <input name="phoneNumber" placeholder="请输入手机号码" class="form-control" type="text"
                                   maxlength="11" th:field="*{phoneNumber}">
                            <span class="input-group-addon"><i class="fa fa-mobile"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label">出生日期：</label>
                    <div class="col-sm-4">
                        <div class="input-group date">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input type="text" class="form-control" id="datetimepicker-demo-2" placeholder="yyyy-MM-dd" th:field="*{dateOfBirth}">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label is-required">身份证号：</label>
                    <div class="col-sm-4">
                        <input class="form-control" type="text" th:field="*{idNumber}"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label">性别：</label>
                    <div class="col-sm-4">
                        <select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                                    th:field="*{sexCode}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<div class="row">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存
        </button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭
        </button>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">

    var prefix = ctx + "pub/pca";
    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-user-edit").serializeArray();
            $.operate.saveTab(prefix + "/edit", data);
        }
    }

    $("#datetimepicker-demo-2").datetimepicker({
        format: "yyyy-mm-dd",
        autoclose: true,
        todayBtn: true,
        todayHighlight: true,
        minView: "month"
    });

</script>
</body>
</html>